package com.gcsoftware.web.beans.returnPage;

import java.util.Comparator;

/**
 * 类比较
 * @author czp
 * data : 2014-04-11
 */
public class BucketsComparator implements Comparator<Buckets> {
    @Override
    public int compare(Buckets o1, Buckets o2) {
        if (o1.equals(o2)) {
            return 0;
        } else if(o1.getDoc_count() > o2.getDoc_count()) {
            return 1;
        } else {
            return -1;
        }
    }
}
